package com.sky.business.sys.event;

import lombok.Data;

import java.math.BigDecimal;

/**
 * 边缘中心心跳事件
 *
 */
@Data
public class EdgeHeartbeatEvent extends BaseEvent {

    private Metadata metadata;

    public EdgeHeartbeatEvent(String edgeId, String edgeIp, String edgeName, BigDecimal latitude, BigDecimal longitude, BigDecimal altitude) {
        super("EdgeHeartBeat", edgeId);
        metadata = new Metadata();
        EdgeInfo edgeInfo = new EdgeInfo();
        edgeInfo.setEdgeIP(edgeIp);
        edgeInfo.setEdgeName(edgeName);
        edgeInfo.setLongitude(longitude);
        edgeInfo.setLatitude(latitude);
        edgeInfo.setAltitude(altitude);
        metadata.setEdgeInfo(edgeInfo);
    }

    @Data
    public static class Metadata {
        private EdgeInfo edgeInfo;
    }

    @Data
    public static class EdgeInfo {
        private String edgeName;
        private String edgeIP;
        private BigDecimal latitude;
        private BigDecimal longitude;
        private BigDecimal altitude;
    }

}
